Skip to content

composability interactor (mesh), part 1#2303

Merged
andrei-marinica merged 55 commits intomasterfrom
finteract
Mar 24, 2026
Merged

composability interactor (mesh), part 1#2303
andrei-marinica merged 55 commits intomasterfrom
finteract

Conversation

@andrei-marinica
Copy link
Contributor

@andrei-marinica andrei-marinica commented Mar 5, 2026

Composability mesh interactor + SDK improvements

This branch builds out a comprehensive multi-shard composability interactor alongside foundational SDK and tooling improvements needed to drive it.


New mesh-node contract

The old forwarder-queue contract has been replaced by a new mesh-node contract (contracts/feature-tests/composability/mesh-node). It serves as a configurable call-tree node capable of exercising every major cross-contract/cross-shard call pattern:

  • Direct EGLD/ESDT transfers
  • Synchronous chained calls
  • Async v1 & v2 calls (single and multi-child)
  • transfer_execute calls
  • Forward/receive payment support across all patterns

The contract name in traits and configs was also unified (renamed from forwarder-queue to mesh-node).


New mesh-interactor

The old interact directory has been replaced by the mesh-interactor crate (contracts/feature-tests/composability/mesh-interactor). This is a feature-complete interactor for running multi-contract, multi-shard call-tree scenarios on a live network:

  • CLI with commands: deploy, call, call-all, cleanup
  • TOML layout configs for each call pattern (direct, sync chain, async v1/v2, transfer-execute) in both minimal and full-shard variants, with and without payment forwarding (12+ layouts)
  • Call tree configuration and generation from TOML; supports multiple children per node, per-node shard assignment, function variants, and gas estimation
  • State management — contract addresses in config.toml separate from layout files
  • Batch deploy all contracts in a single run
  • Cross-shard async support — tested against all shard combinations (s0→s0, s0→s1, s0→s2, etc.)

SDK: per-shard test wallets

Three new named test wallets are added to sdk/core, each guaranteed to reside in a specific shard on a 3-shard testnet:

Function Shard Note
sophie() 0 address ends in …0000
simon() 1 address ends in …0001
szonja() 2 address ends in …0002

A convenience for_shard(shard_id: u32) function dispatches to the appropriate wallet.


SDK: gateway URL trailing-slash fix

GatewayHttpProxy and GatewayDappProxy now strip a trailing / from the URL supplied at construction time, preventing double-slash URLs like https://gateway.example.com//address/....


SDK: TransactionOnNetwork deserialization robustness

Several fields that may be absent in certain network responses (block_nonce, block_hash, miniblock_type, miniblock_hash, timestamp) are now annotated with #[serde(default)], preventing deserialization panics for pending or cross-shard transactions.

Error messages in the transaction retrieval loop now include the transaction hash for easier debugging.


sc-meta proxy --verbose flag

A new --verbose flag is added to sc-meta all proxy (and the per-contract proxy sub-command). When set, after generating the proxy it prints a categorised summary of all types encountered:

  • Types defined in proxy — local types included verbatim
  • Types not generated — skipped because a [[proxy.path-rename]] rule covers their crate
  • External type dependencies — types from other crates (with a hint to configure path-rename)

This is useful when authoring proxies that import types from sibling crates.


Proxy generator: path-rename type skipping

The proxy generator now respects [[proxy.path-rename]] entries not only for renaming import paths in function signatures, but also to suppress type re-generation for types whose crate is covered by a rename rule. This avoids duplicate struct/enum definitions when the consumer already imports them from the original crate.


Other / cleanup

  • Deleted forw_queue_async.scen.json scenario (replaced by the mesh-interactor approach)
  • Removed vault/sc-config.toml (no longer needed)
  • Minor CodeMetadata doc improvements
  • chain/core shard config additions used by the mesh interactor
  • ManagedVec / MultiValueManagedVec / ManagedBuffer minor additions required by the interactor

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Contract comparison - from 5197b19 to 142aca2

Path                                                                                             size                  has-allocator                     has-format
large-storage.wasm 1656 false None
vec-repeat.wasm 4872 false None
single-value-repeat.wasm 4253 false None
queue-repeat.wasm 5536 false None
linked-list-repeat.wasm 6838 false without message
map-repeat.wasm 7363 false without message
set-repeat.wasm 6511 false None
str-repeat.wasm 2733 false without message
str-repeat-mb-builder-cached.wasm 1109 false without message
str-repeat-mb-builder-basic.wasm 757 false None
send-tx-repeat.wasm 1292 false None
recursive-caller.wasm 5163 false without message
local-esdt-and-nft.wasm 12568 false without message
forwarder-raw-init-async-call.wasm 2374 false None
forwarder-raw-init-sync-call.wasm 2958 false None
forwarder-raw.wasm 13081 false None
vault-upgrade.wasm 708 false None
vault.wasm 8950 false None
forwarder.wasm 49004 false without message
proxy-test-second.wasm 2332 false without message
parent.wasm 1999 false None
child.wasm 3982 false without message
transfer-role-features.wasm 8605 false without message
first-contract.wasm 3450 false None
second-contract.wasm 1158 false None
forwarder-blind.wasm 13978 false without message
proxy-test-first.wasm 5707 false without message
builtin-func-features.wasm 3828 false None
forwarder-legacy.wasm 33620 false without message
basic-features-small-int-bug.wasm 824 false None
basic-features.wasm 85948 false without message
basic-features-storage-bytes.wasm 541 false None
abi-tester.wasm 8607 true without message
abi-tester-ev.wasm 760 false None
rust-snippets-generator-test.wasm 4708 false None
formatted-message-features.wasm 3613 false without message
use-module-view.wasm 736 false None
use-module.wasm 32477 false without message
payable-features.wasm 6046 false None
exchange-features.wasm 1514 false None
forbidden-opcodes.wasm 842 false None
scenario-tester.wasm 1374 false None
std-contract.wasm 3469 true without message
big-float-features.wasm 6373 false without message
rust-testing-framework-tester.wasm 8552 false None
multi-contract-alt-impl.wasm 353 false None
multi-contract-features.wasm 681 false None
multi-contract-example-feature.wasm 680 false None
multi-contract-features-view.wasm 1113 false None
panic-message-features.wasm 13030 false with message
panic-message-std.wasm 16073 false with message
erc1155-user-mock.wasm 1229 false None
lottery-erc20.wasm 12886 false without message
erc721.wasm 2232 false None
crowdfunding-erc20.wasm 4909 false without message
erc1155-marketplace.wasm 10602 false without message
erc1155.wasm 12016 false without message
erc20.wasm 1887 false None
esdt-system-sc-mock.wasm 4556 false None
alloc-features.wasm 23260 false without message
alloc-mem-fail.wasm 17812 true without message
alloc-mem-leaking.wasm 23417 false without message
multiversx-wegld-swap-sc.wasm 4265 false None
multiversx-price-aggregator-sc.wasm 17904 false without message
ping-pong-egld.wasm 6397 false None
multisig-full.wasm 15128 false without message
multisig-view.wasm 5590 false None
multisig.wasm 13617 false without message
bonding-curve-contract.wasm 14067 false None
kitty-genetic-alg.wasm 3494 false without message
kitty-auction.wasm 9389 false without message
kitty-ownership.wasm 12965 false without message
check-pause.wasm 1260 false None
digital-cash.wasm 9736 false None
fractional-nfts.wasm 8302 false without message
adder.wasm 699 false None
order-book-pair.wasm 14099 false None
order-book-factory.wasm 3401 false None
empty.wasm 244 false None
esdt-transfer-with-fee.wasm 7505 false without message
nft-subscription.wasm 8725 false without message
proxy-pause.wasm 4165 false None
seed-nft-minter.wasm 14189 false without message
crowdfunding.wasm 3574 false None
nft-storage-prepay.wasm 2609 false None
crypto-bubbles.wasm 2561 false None
crypto-zombies.wasm 9282 false without message
nft-minter.wasm 9726 false without message
lottery-esdt.wasm 10580 false without message
factorial.wasm 579 false None
rewards-distribution.wasm 9445 false without message
token-release.wasm 6978 false without message

@andrei-marinica andrei-marinica changed the title composability interactor composability interactor (mesh) Mar 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “mesh-node” composability test contract and a new “mesh-interactor” CLI tool for configuring/deploying/running composability call-tree scenarios, while also improving proxy generation/type handling and a few SDK ergonomics.

Changes:

  • Add mesh-node smart contract + wasm/meta artifacts; replace/remove older forwarder-queue + interact tooling.
  • Add mesh-interactor CLI (layout generation, gas estimation, deploy, program calls/returns, bump, trace info) and a set of pre-generated layouts.
  • Improve proxy generation behavior around path-renames/type reporting, add convenience From<[...; N]> conversions, and make transaction deserialization more tolerant via serde(default).

Reviewed changes

Copilot reviewed 77 out of 82 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
sdk/http/src/gateway_http_proxy.rs Adds a trailing-slash assert on proxy URI before formatting request URL.
sdk/dapp/src/gateway_dapp_proxy.rs Adds a trailing-slash assert on proxy URL before formatting request URL.
sdk/core/src/test_wallets/s0phie.pem Adds a new test wallet PEM file.
sdk/core/src/test_wallets/s1mon.pem Adds a new test wallet PEM file.
sdk/core/src/test_wallets/s2onja.pem Adds a new test wallet PEM file.
sdk/core/src/test_wallets.rs Adds shard-targeted test wallets + for_shard() helper.
sdk/core/src/retrieve_tx_on_network.rs Improves panic message on tx retrieval failure; adjusts log message; adds an import.
sdk/core/src/data/transaction.rs Makes several tx-on-network fields defaultable during serde deserialization.
framework/meta-lib/src/contract/generate_proxy/proxy_process_type_name.rs Documents + tests extract_struct_crate().
framework/meta-lib/src/contract/generate_proxy/proxy_generator.rs Adds proxy type summary printing; skips type generation when path-rename applies.
framework/base/src/types/managed/wrapped/managed_vec.rs Adds From<[I; N]> for ManagedVec convenience conversion.
framework/base/src/types/managed/multi_value/multi_value_managed_vec.rs Adds IgnoreValue support, as_vec(), and extra TypeAbiFrom impls.
framework/base/src/types/managed/basic/managed_buffer.rs Adds From<[u8; N]> for ManagedBuffer convenience conversion.
contracts/feature-tests/composability/wasm/src/lib.rs Updates generated wasm adapter endpoints block (now referencing mesh_node).
contracts/feature-tests/composability/wasm/Cargo.toml Renames wasm package and changes dependency wiring.
contracts/feature-tests/composability/vault/sc-config.toml Removes a proxy generation entry for the old interact tooling.
contracts/feature-tests/composability/tests/composability_scenario_rs_test.rs Switches scenario registration to mesh-node; ignores one test as WIP.
contracts/feature-tests/composability/tests/composability_scenario_go_test.rs Ignores one test as WIP.
contracts/feature-tests/composability/mesh-node/wasm/src/lib.rs Adds generated wasm adapter for mesh-node.
contracts/feature-tests/composability/mesh-node/wasm/Cargo.toml Renames wasm package and dependency to mesh-node.
contracts/feature-tests/composability/mesh-node/wasm/Cargo.lock Updates lockfile entries from forwarder-queue to mesh-node.
contracts/feature-tests/composability/mesh-node/src/mesh_node_proxy.rs Adds generated proxy for mesh-node contract calls.
contracts/feature-tests/composability/mesh-node/src/mesh_node.rs Adds the new mesh-node contract implementation + types.
contracts/feature-tests/composability/mesh-node/sc-config.toml Adds contract build/proxy config (including path-rename).
contracts/feature-tests/composability/mesh-node/multiversx.json Adds multiversx contract metadata file.
contracts/feature-tests/composability/mesh-node/meta/src/main.rs Adds meta crate entrypoint.
contracts/feature-tests/composability/mesh-node/meta/Cargo.toml Renames meta package and dependency to mesh-node.
contracts/feature-tests/composability/mesh-node/Cargo.toml Renames contract crate and lib path to mesh-node sources.
contracts/feature-tests/composability/mesh-interactor/src/mesh_interact_state.rs Renames persisted address field to mesh_node_address.
contracts/feature-tests/composability/mesh-interactor/src/mesh_interact_main.rs Adds new mesh-interactor CLI entrypoint and commands.
contracts/feature-tests/composability/mesh-interactor/src/mesh_interact_controller.rs Adds controller init (gateway + wallets + code loading).
contracts/feature-tests/composability/mesh-interactor/src/mesh_interact_cli.rs Adds clap CLI definitions for mesh-interactor.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_info.rs Adds trace querying/pretty-printing logic.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_gas.rs Adds recursive gas estimation and layout updating.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_deploy.rs Adds batched deploy logic and state persistence.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_config_gen.rs Adds layout generator producing multiple scenario permutations.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_config.rs Adds TOML schema + load/save helpers for layouts/state/config.
contracts/feature-tests/composability/mesh-interactor/src/call_tree_calling_functions.rs Adds on-chain programming of calls/returns + bump execution.
contracts/feature-tests/composability/mesh-interactor/layouts/*.toml Adds multiple generated scenario layouts.
contracts/feature-tests/composability/mesh-interactor/current.toml Adds a generated “current state” file with concrete addresses/wallets.
contracts/feature-tests/composability/mesh-interactor/config.toml Adds a default config pointing at a specific layout + gateway.
contracts/feature-tests/composability/mesh-interactor/all.sh Adds a helper shell script to run a sequence of commands.
contracts/feature-tests/composability/mesh-interactor/Cargo.toml Renames package/binary and wires in mesh-node dependency.
contracts/feature-tests/composability/mesh-interactor/.gitignore Adjusts ignored artifacts for the new interactor layout.
contracts/feature-tests/composability/interact/src/vault_proxy.rs Removes old generated vault proxy.
contracts/feature-tests/composability/interact/src/forwarder_queue_proxy.rs Removes old generated forwarder-queue proxy.
contracts/feature-tests/composability/interact/src/comp_interact_main.rs Removes old interactor entrypoint.
contracts/feature-tests/composability/interact/src/comp_interact_controller.rs Removes old interactor controller.
contracts/feature-tests/composability/interact/src/comp_interact_config.rs Removes old interactor config loader.
contracts/feature-tests/composability/interact/src/comp_interact_cli.rs Removes old interactor CLI.
contracts/feature-tests/composability/interact/src/call_tree_deploy.rs Removes old deploy helper.
contracts/feature-tests/composability/interact/src/call_tree_calling_functions.rs Removes old call programming logic.
contracts/feature-tests/composability/interact/src/call_tree.rs Removes old in-memory call tree model.
contracts/feature-tests/composability/interact/config.toml Removes old interactor config file.
contracts/feature-tests/composability/forwarder-queue/wasm-forwarder-queue/src/lib.rs Removes old forwarder-queue wasm adapter.
contracts/feature-tests/composability/forwarder-queue/wasm-forwarder-queue-promises/Cargo.lock Removes old forwarder-queue-promises lockfile.
contracts/feature-tests/composability/forwarder-queue/src/forwarder_queue.rs Removes old forwarder-queue contract implementation.
contracts/feature-tests/composability/forwarder-queue/sc-config.toml Removes old forwarder-queue sc-config.
contracts/feature-tests/composability/forwarder-queue/meta/src/main.rs Removes old forwarder-queue meta entrypoint.
contracts/feature-tests/composability/Cargo.toml Swaps dev-dependency from forwarder-queue to mesh-node.
chain/core/src/types/shard_config.rs Adds serde derives for ShardId behind feature flag.
chain/core/src/types/flags/code_metadata.rs Adds documentation/comments clarifying CodeMetadata flags and helpers.
Cargo.toml Replaces workspace members: remove old interact/forwarder-queue; add mesh-node + mesh-interactor.
Cargo.lock Updates workspace lock entries to mesh-node + mesh-interactor; removes old interact/forwarder-queue.
CHANGELOG.md Fixes callback attribute name in changelog snippet (promises_callback).
.gitignore Adds .DS_Store.
.claude.md Adds repository guidelines about not editing generated files.
Comments suppressed due to low confidence (2)

contracts/feature-tests/composability/wasm/Cargo.toml:32

  • This wasm crate depends on composability-tests (a test harness) but the generated endpoints reference mesh_node. This will likely fail to compile/link because the contract module isn’t provided by that dependency. The dependency here should point to the actual contract crate being exported (e.g. mesh-node) and the package name should match what it builds.
    contracts/feature-tests/composability/wasm/src/lib.rs:29
  • The exported endpoints listed here (queued_calls, set_queued_calls, callback_count, etc.) don’t match the endpoints defined in the mesh-node contract (which uses programmed_calls, programmed_returns, trace, programCalls, programReturns, etc.). This mismatch is likely to cause build failures or runtime ABI inconsistencies; regenerate this wasm adapter from the correct contract crate / trait.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrei-marinica andrei-marinica marked this pull request as ready for review March 24, 2026 11:40
@andrei-marinica andrei-marinica changed the title composability interactor (mesh) composability interactor (mesh), part 1 Mar 24, 2026
@andrei-marinica andrei-marinica merged commit bc6ec1b into master Mar 24, 2026
23 checks passed
@andrei-marinica andrei-marinica deleted the finteract branch March 24, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants